using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data;
namespace prDe_Tai.DuLieu
{
    class ThemDuLieu
    {
        public void themdulieuvaobang_DanhSachPhanMem(int sothutu,string tenphanmem, string chucnang, string diachidownload, string loaiphanmem, string chude)
        {
            OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=QuanLyPhanMem.mdb");
            OleDbCommand com = new OleDbCommand();
            com.Connection = con;
            com.CommandType = CommandType.Text;
            com.CommandText = "insert into DanhSachPhanMem(sothutu,tenphanmem,chucnang,diachidownload,loaiphanmem,chude) values(@sothutu,@tenphanmem,@chucnang,@diachidownload,@loaiphanmem,@chude)";
            com.Parameters.Add("@sothutu", OleDbType.Numeric).Value =sothutu;
            com.Parameters.Add("@tenphanmem", OleDbType.BSTR).Value = tenphanmem;
            com.Parameters.Add("@chucnang", OleDbType.BSTR).Value =chucnang;
            com.Parameters.Add("@diachidownload", OleDbType.BSTR).Value =diachidownload;
            com.Parameters.Add("@loaiphanmem", OleDbType.BSTR).Value =loaiphanmem;
            com.Parameters.Add("@chude", OleDbType.BSTR).Value =chude;
            con.Open();
            com.ExecuteNonQuery();
            con.Close();
        }
        public void themdulieuvaobang_DanhSachBoSuuTap(int sothutu,string tenphanmem, string chude, string chucnang, string loaiphanmem, string diachidownload)
        {
            OleDbConnection con = new OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=QuanLyPhanMem.mdb");
            OleDbCommand com = new OleDbCommand();
            com.Connection = con;
            com.CommandType = CommandType.Text;
            com.CommandText = "insert into DanhSachBoSuuTap(sothutu,tenphanmem,chude,chucnang,loaiphanmem,diachidownload) values(@sothutu,@tenphanmem,@chude,@chucnang,@loaiphanmem,@diachidownload)";
            com.Parameters.Add("@sothutu", OleDbType.Numeric).Value = sothutu;
            com.Parameters.Add("@tenphanmem", OleDbType.BSTR).Value =tenphanmem;
            com.Parameters.Add("@chude", OleDbType.BSTR).Value =chude;
            com.Parameters.Add("@chucnang", OleDbType.BSTR).Value =chucnang;
            com.Parameters.Add("@loaiphanmem", OleDbType.BSTR).Value = loaiphanmem;
            com.Parameters.Add("@diachidownload", OleDbType.BSTR).Value = diachidownload;
            con.Open();
            com.ExecuteNonQuery();
            con.Close();
        }
    }
}
